import 'package:json_annotation/json_annotation.dart';

part 'contacts.g.dart';

@JsonSerializable(explicitToJson: true)
class contacts {
  List<contact> messages;

  contacts(this.messages);

  factory contacts.fromJson(Map<String, dynamic> json) =>
      _$contactsFromJson(json);

  Map<String, dynamic> toJson() => _$contactsToJson(this);
}

@JsonSerializable(explicitToJson: true)
class contact {
  int another_user_id;
  String last_message;
  String another_user_name;

  contact(this.another_user_id, this.last_message, this.another_user_name);

  factory contact.fromJson(Map<String, dynamic> json) =>
      _$contactFromJson(json);

  Map<String, dynamic> toJson() => _$contactToJson(this);
}
